package com.carey.blog.sync;

import java.util.Date;
import java.util.Map;
import java.util.Set;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Post(Article/Entry).
 * 
 */
public interface Post {
	/**
	 * Gets the permalink.
	 * 
	 * @return permalink
	 */
	String getPermalink();

	/**
	 * Gets the create date.
	 * 
	 * @return create date
	 */
	Date getCreateDate();

	/**
	 * Sets the create date with the specified create date.
	 * 
	 * @param createDate
	 *            the specified create date
	 */
	void setCreateDate(final Date createDate);

	/**
	 * Gets the id.
	 * 
	 * @return id
	 */
	String getId();

	/**
	 * Sets the id with the specified id.
	 * 
	 * @param id
	 *            the specified id
	 */
	void setId(final String id);

	/**
	 * Gets the content.
	 * 
	 * @return content
	 */
	String getContent();

	/**
	 * Sets the content with the specified content.
	 * 
	 * @param content
	 *            the specified content
	 */
	void setContent(final String content);

	/**
	 * Gets the title.
	 * 
	 * @return title
	 */
	String getTitle();

	/**
	 * Sets the title with the specified title.
	 * 
	 * @param title
	 *            the specified title
	 */
	void setTitle(final String title);

	/**
	 * Gets the categories.
	 * 
	 * @return categories
	 */
	Set<String> getCategories();

	/**
	 * Sets the categories with the specified categories.
	 * 
	 * @param categories
	 *            the specified categories
	 */
	void setCategories(final Set<String> categories);

	/**
	 * Adds the specified category.
	 * 
	 * @param category
	 *            the specified category
	 */
	void addCategory(final String category);

	/**
	 * Transforms this object to a json object.
	 * 
	 * @return json object
	 * @throws JSONException
	 *             json exception
	 */
	JSONObject toJSONObject() throws JSONException;

	/**
	 * Transforms this object to a MetaWeblog post structure.
	 * 
	 * @return MetaWeblog post structure
	 */
	Map<String, Object> toMetaWeblogPost();
}
